<template>
  <div>
    <header v-on:click="changedTitle">
      <h1>
        {{title}}
      </h1>
    </header>
    <router-link to="/demotest"> demo测试 </router-link>
  </div>

</template>

<!-- 行为方法 -->
<script>
  export default{
    name: 'ff',
    data(){
      return {
        title: "Vue.js DEMO"
      }
    },
    props: ['fyf'],

    methods: {
      changedTitle(){
        this.$emit("titleChange", "子向父传值，我是新title")
      }

    }


  }

</script>
<!-- 样式 -->
<style scoped>
  header {
    background: #21aaff;
    padding: 10px;
  }

  h1 {
    color: white;
  }

  .yang {
    text-align: center;
  }
</style>
